// import Study from '@/views/study';
import App from '@/views/App';
// import Fast from '@/views/Fast';
// import Home from '@/views/Home';
import Login from '@/views/Login';
// import Practice from '@/views/Practice';
// import SelectPractice from '@/views/SelectPractice';
// import User from '@/views/User';
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
// react 里面的路由懒加载
// React.lazy(()=>import(组件的路径))
import { lazy } from 'react';
const Home = lazy(() => import('../views/Home'));
const Fast = lazy(() => import('../views/Fast'));
const Practice = lazy(() => import('../views/Practice'));
const SelectPractice = lazy(() => import('../views/SelectPractice'));
const User = lazy(() => import('../views/User'));
const Study = lazy(() => import('../views/study'));
const router = (
  <Router>
    <Routes>
      <Route path="/login" element={<Login />}></Route>
      <Route path="/" element={<App />}>
        <Route path="home" element={<Home />}></Route>
        {/* <Route index element={<Home />}></Route> */}
        <Route path="fast" element={<Fast />}></Route>
        <Route path="mine" element={<User />}></Route>
        <Route path="select" element={<SelectPractice />}></Route>
        <Route path="practice/:actionCode" element={<Practice />}></Route>
        <Route path="study" element={<Study />}></Route>
      </Route>
    </Routes>
  </Router>
);
export default router;
